<?php

namespace App\Controllers;

use Xxh\Bos\BosStorage;

class CompressController extends  Collect
{

    public function writeFile()
    {

        $this->savePath = $this->savePath.bin2hex($this->url).'.png';
        $content = resolve('request')->getContent($this->url);
        file_put_contents($this->savePath,$content);
    }

    public function __destruct()
    {

        resolve('bos')->upload($this->savePath);
    }

}
